package org.shiftone.cdep.store;

import org.shiftone.cdep.store.StoreException;

import java.util.List;
import java.util.Map;
import java.sql.Connection;

public interface StoreManager
{
    void setConnection(Connection connection);
    Connection getConnection();

    int setImportLocation(String importLocation) throws StoreException;

    int setPackage(String packageName, Integer parentId) throws StoreException;

    void buildPackageTree() throws StoreException;

    int getClass(String className) throws StoreException;

    int setUnknownClass(String className, Integer packageId) throws StoreException;

    int setClass(String className, Integer packageId, Boolean isInterface, Boolean isInner, Integer parentClassId, Integer importLocation) throws StoreException;

    void dropClass(String className) throws StoreException;

    void dropClass(int classId) throws StoreException;

    void setClassImplements(int classId, int interfaceClassId) throws StoreException;

    int getMethod(int classId, String methodName, String methodSignature) throws StoreException;

    int setMethod(int classId, String methodName, String methodSignature) throws StoreException;

    void dropMethod(int classId, String methodName, String methodSiguature) throws StoreException;

    void dropMethod(int methodId) throws StoreException;

    void setMethodCall(int methodCallerId, int methodCalleeId) throws StoreException;

    void setClassCall(int callerClassId, int calleeClassId) throws StoreException;

    List queryClasses() throws StoreException;

    List queryClassDependencies() throws StoreException;

    List queryClassMethods() throws StoreException;

    Map queryClass(int classId) throws StoreException;

    Map queryMethod(int methodId) throws StoreException;

    void shutdown();
}
